<?php /*a:2:{s:67:"D:\phpstudy_pro\WWW\www.xnadmin.site\app\site\view\module\form.html";i:1616229438;s:60:"D:\phpstudy_pro\WWW\www.xnadmin.site\app\site\view\main.html";i:1616144497;}*/ ?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>远程站点管理 - 17商机网</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <script>
        //全局上传文件端口
        var UPLOAD_FILE_URL = "<?php echo url('upload_files/upload'); ?>";
        //全局选择文件端口
        var SELECT_FILE_URL = "<?php echo url('upload_files/select'); ?>";
    </script>
    <script src="/static/admin/js/jquery-2.0.0.min.js"></script>
    <script src="/static/admin/js/common.js"></script>
    <script src="/static/admin/js/upload.js"></script>
    <script src="/static/admin/js/webuploader.min.js"></script>
    <link rel="stylesheet" href="/static/admin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/admin/style/layuiAdmin.css" media="all">
    <link rel="stylesheet" href="/static/admin/style/base.css" media="all">
    
</head>
<body>

<div class="layui-card layadmin-header">
    <div class="layui-breadcrumb" lay-filter="breadcrumb" style="visibility: visible;">
        <a href="<?php echo url('index/home',array('webid'=>$web['id'])); ?>"><?php echo htmlentities($web['title']); ?></a>
        <a href="<?php echo url('module/index',array('webid'=>$web['id'],'moduleid'=>$module['moduleid'])); ?>"><?php echo htmlentities($module['name']); ?></a>
        <a><cite>编辑</cite></a>
    </div>
</div>
<div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">
    <form action="<?php echo request()->url(); ?>" method="post" class="xn_ajax2" data-type="open">
        <div class="layui-form-item">
            <label class="layui-form-label">所属分类</label>
            <div class="layui-input-inline">
                <select name="typeid" id="typeid">
                    <option value="0">选择类型</option>
                    <?php if(is_array($categorylist) || $categorylist instanceof \think\Collection || $categorylist instanceof \think\Paginator): if( count($categorylist)==0 ) : echo "" ;else: foreach($categorylist as $key=>$vo): ?>
                        <option value="<?php echo htmlentities($vo['catid']); ?>" <?php if($vo['catid']==$data['catid']): ?>selected<?php endif; ?>><?php echo htmlentities($vo['catname']); ?></option>
                        <?php if(is_array($vo['children']) || $vo['children'] instanceof \think\Collection || $vo['children'] instanceof \think\Paginator): if( count($vo['children'])==0 ) : echo "" ;else: foreach($vo['children'] as $key=>$vo2): ?>
                        <option value="<?php echo htmlentities($vo2['catid']); ?>" <?php if($vo2['catid']==$data['catid']): ?>selected<?php endif; ?>>├&nbsp;<?php echo htmlentities($vo2['catname']); ?></option>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    <?php endforeach; endif; else: echo "" ;endif; ?>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><?php echo htmlentities($module['name']); ?>标题</label>
            <div class="layui-input-block">
                <input type="text" name="title" lay-verify="required" placeholder="" autocomplete="off" class="layui-input" value="<?php echo htmlentities($data['title']); ?>">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">关键词</label>
            <div class="layui-input-block">
                <input type="text" name="keywords" placeholder="" autocomplete="off" class="layui-input" value="<?php echo htmlentities($data['tag']); ?>">
            </div>
        </div>
        <?php if(is_array($fields) || $fields instanceof \think\Collection || $fields instanceof \think\Paginator): if( count($fields)==0 ) : echo "" ;else: foreach($fields as $key=>$vo): switch($vo['html']): case "text": ?>
            <div class="layui-form-item">
                <label class="layui-form-label"><?php echo htmlentities($vo['title']); ?></label>
                <div class="layui-input-block">
                    <input type="text" name="<?php echo htmlentities($vo['name']); ?>" placeholder="" autocomplete="off" class="layui-input" value="<?php echo htmlentities($data[$vo['name']]); ?>">
                </div>
            </div>
            <?php break; case "checkbox": $check_arr = explode(",",$data[$vo['name']]); ?>
            <div class="layui-form-item">
                <label class="layui-form-label"><?php echo htmlentities($vo['title']); ?></label>
                <div class="layui-input-block">
                    <?php $arr = explode("\r\n",$vo['option_value']); if(is_array($arr) || $arr instanceof \think\Collection || $arr instanceof \think\Paginator): if( count($arr)==0 ) : echo "" ;else: foreach($arr as $key=>$val): $v = explode("|",$val); ?>
                        <input <?php if(in_array($v[0],$check_arr)): ?>checked<?php endif; ?> type="checkbox" name="<?php echo htmlentities($vo['name']); ?>[]" value="<?php echo htmlentities($v[0]); ?>" title="<?php echo trim($v[0]); ?>">
                    <?php endforeach; endif; else: echo "" ;endif; ?>
                </div>
            </div>
            <?php break; ?>
        <?php endswitch; ?>
        <?php endforeach; endif; else: echo "" ;endif; ?>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label"><?php echo htmlentities($module['name']); ?>简介</label>
            <div class="layui-input-block">
                <textarea name="description" class="layui-textarea"><?php echo htmlentities($data['introduce']); ?></textarea>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label"><?php echo htmlentities($module['name']); ?>内容</label>
            <div class="layui-input-block" id="tags">
                <blockquote class="layui-elem-quote layui-quote-nm">
                <div class="layui-inline">
                    <button type="button" class="layui-btn layui-btn-normal" style="background-color: #<?php echo randColor(); ?>;">条件</button>
                </div>
                <div class="layui-inline">
                    <button type="button" class="layui-btn layui-btn-normal" style="background-color: #<?php echo randColor(); ?>;">优势</button>
                </div>
                <div class="layui-inline">
                    <button type="button" class="layui-btn layui-btn-normal" style="background-color: #<?php echo randColor(); ?>;">流程</button>
                </div>
                <div class="layui-inline">
                    <button type="button" class="layui-btn layui-btn-normal" style="background-color: #<?php echo randColor(); ?>;">支持</button>
                </div>
                <div class="layui-inline">
                    <button type="button" class="layui-btn layui-btn-normal" style="background-color: #<?php echo randColor(); ?>;">费用表格</button>
                </div>
                <div class="layui-inline">
                    <button type="button" class="layui-btn layui-btn-normal" style="background-color: #<?php echo randColor(); ?>;">利润表格</button>
                </div>
                <div class="layui-inline">
                    <button type="button" class="layui-btn layui-btn-normal" style="background-color: #<?php echo randColor(); ?>;">过渡段落</button>
                </div>
                <div class="layui-inline">
                    <button type="button" class="layui-btn layui-btn-normal" style="background-color: #<?php echo randColor(); ?>;">复用段落</button>
                </div>
                <div class="layui-inline">
                    <button type="button" class="layui-btn layui-btn-normal" style="background-color: #<?php echo randColor(); ?>;">图片</button>
                </div>
                </blockquote>
            </div>
            <div class="layui-input-block">
                <div class="layui-input-inline" style="width: 48%;">
                    <blockquote class="layui-elem-quote layui-quote-nm">
                        编辑内容：
                        <div class="layui-inline">
                            <button id="makeContent" type="button" class="layui-btn layui-btn-normal" style="background-color: #<?php echo randColor(); ?>;">生成</button>
                        </div>
                        <div class="layui-inline">
                            <input id="dalei" type="text" class="layui-input" placeholder="大类" value="" style="width: 100px;">
                        </div>
                        <div class="layui-inline">
                            <input id="xiaolei" type="text" class="layui-input" placeholder="小类" value="" style="width: 100px;">
                        </div>
                        <div class="layui-inline">
                            <input id="xiangmu" type="text" class="layui-input" placeholder="项目" value="" style="width: 100px;">
                        </div>
                    </blockquote>
                    <textarea id="content_temp"></textarea>
                </div>
                <div class="layui-input-inline" style="width: 48%;">
                    <blockquote class="layui-elem-quote layui-quote-nm">
                        最终内容：
                        <div class="layui-inline">
                            <button type="button" class="layui-btn layui-btn-normal" style="background-color: #<?php echo randColor(); ?>;">清空</button>
                        </div>
                    </blockquote>
                    <textarea name="content" id="content"><?php echo htmlentities($data['content']); ?></textarea>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="submit" lay-submit class="layui-btn">发布</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>


<script src="/static/admin/layui/layui.all.js"></script>
<script src="/static/admin/js/admin.js"></script>

<!--编辑器-->
<script src="/static/admin/ueditor/ueditor.config.js"></script>
<script src="/static/admin/ueditor/ueditor.all.min.js"></script>
<script src="/static/admin/ueditor/lang/zh-cn/zh-cn.js"></script>
<script>
    var ue_temp = UE.getEditor('content_temp',{
        initialFrameWidth : '100%',// 设置编辑器宽度
        initialFrameHeight:400,// 设置编辑器高度
        autoHeightEnabled: false
    });
    var ue = UE.getEditor('content',{
        initialFrameWidth : '100%',// 设置编辑器宽度
        initialFrameHeight:400,// 设置编辑器高度
        autoHeightEnabled: false
    });

    var tags = $('#tags').find('button');
    $.each(tags,function(index,item){
        $(item).click(function(){
            var str = '[TAG:'+$(this).text()+']';
            ue_temp.focus();
            ue_temp.execCommand('inserthtml', str);
        });
    });
    $(function(){
        $('#makeContent').click(function(){
            var dalei = $('#dalei').val();
            var xiaolei = $('#dalei').val();
            var xiangmu = $('#dalei').val();
            var content = ue_temp.getContent();
            $.post("<?php echo url('admin/ajax/makeContent',array('webid'=>$web['id'])); ?>",{dalei:dalei,xiaolei:xiaolei,xiangmu:xiangmu,content:content},function(res){
                if(res.status){
                    ue.ready(function() {
                        ue.setContent(res.data);
                    });
                }
                // layer.msg(res.msg,{time:1500});
            });
       });
    });
</script>

</body>
</html>